<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCustomPaymentShopMappingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('custom_payment_shop_mappings', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('shopId')->default(0)->comment('店铺id');
            $table->unsignedInteger('payId')->default(0)->comment('自定义支付id');
            $table->unsignedTinyInteger('status')->default(0)->comment('状态 0 正常 1 停用');
            $table->integer('createdAt')->default(0)->comment('创建时间');
            $table->integer('createdByUid')->default(0)->comment('创建人');
            $table->integer('updatedAt')->default(0)->comment('修改时间');
            $table->integer('updatedByUid')->default(0)->comment('修改人');
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment("是否删除 0：未删除 1：已删除");

            $table->index('shopId', 'idx_shopId');
            $table->index('payId', 'idx_payId');
            $table->index('createdAt', 'idx_createdAt');
            $table->comment = '自定义支付店铺关联表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('custom_payment_shop_mappings');
    }
}
